/*
 * @Description: 用户访问记录实体
 * @Author: liks
 * @Date: 2025-01-23 14:37:15
 * @LastEditors: liks
 * @LastEditTime: 2025-01-23 16:02:46
 */
import { Column, Entity, CreateDateColumn } from 'typeorm';
import { BaseEntity } from '../../../common/baseEntity/index';

// 用户访问记录表
@Entity('user-visit')
export class UserVisit extends BaseEntity {
  @Column({
    type: 'varchar',
    length: 64,
    comment: '用户id',
    nullable: true,
  })
  userId: string;

  @Column({
    type: 'varchar',
    length: 64,
    comment: 'ipv4地址',
    nullable: true,
  })
  ip: string;

  @Column({
    type: 'varchar',
    length: 64,
    comment: '访问设备',
    nullable: true,
  })
  device: string;

  @Column({ type: 'varchar', length: 100, nullable: true, comment: '地区' })
  region: string;

  @CreateDateColumn({
    type: 'timestamp',
    nullable: false,
    name: 'visit_time',
    comment: '访问时间',
  })
  visitTime: Date;
}
